package com.zhenta;

import com.zhentao.pojo.Appointment;
import com.zhentao.pojo.AppointmentVO;
import com.zhentao.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 预约挂号服务Feign接口
 */
@FeignClient(name = "appointment-service", path = "/appointment", contextId = "appointmentFeign")
public interface AppointmentServiceFeign {

    /**
     * 获取预约挂号列表
     */
    @GetMapping("/list")
    Result<List<AppointmentVO>> getAppointmentList();

    /**
     * 根据ID获取预约挂号详情
     */
    @GetMapping("/{id}")
    Result<AppointmentVO> getAppointmentById(@PathVariable("id") Integer id);

    /**
     * 创建预约挂号
     */
    @PostMapping("/create")
    Result<String> createAppointment(@RequestBody Appointment appointment);

    /**
     * 取消预约挂号
     */
    @PutMapping("/cancel/{id}")
    Result<String> cancelAppointment(@PathVariable("id") Integer id);

    /**
     * 完成预约挂号
     */
    @PutMapping("/complete/{id}")
    Result<String> completeAppointment(@PathVariable("id") Integer id);

    /**
     * 根据就诊人ID获取预约挂号列表
     */
    @GetMapping("/patient/{patientId}")
    Result<List<AppointmentVO>> getAppointmentsByPatientId(@PathVariable("patientId") Integer patientId);

    /**
     * 根据状态获取预约挂号列表
     */
    @GetMapping("/status/{status}")
    Result<List<AppointmentVO>> getAppointmentsByStatus(@PathVariable("status") Integer status);
}